Skip to content

[Breadcrumbs] Build separators in one pass - #49058

Open
OskarEichler wants to merge 1 commit into
mui:masterfrom
OskarEichler:codex/mui-breadcrumbs-linear-separators
Open

[Breadcrumbs] Build separators in one pass#49058
OskarEichler wants to merge 1 commit into
mui:masterfrom
OskarEichler:codex/mui-breadcrumbs-linear-separators

Conversation

@OskarEichler

Copy link
Copy Markdown

What changed

  • Builds the interleaved breadcrumb/separator array with push in one pass instead of repeatedly copying the growing accumulator with concat.
  • Preserves item order, separator order, keys, and rendered output.
  • No public API or observable behavior changes.

The previous reduction is quadratic in the number of children because each separator copies all preceding entries. The new reduction is linear.

Verification

  • Synthetic 10,000-item, 7-sample benchmark:
    • before median: 271.284 ms
    • after median: 0.285 ms
  • Exact output length, first-item, and last-item assertions passed.
  • pnpm test:unit run Breadcrumbs --project 'node:@mui/material'
  • pnpm -F @mui/material typescript
  • Targeted ESLint and Prettier checks.
  • Full pnpm release:build.
  • Full Material Node unit suite: 179 passed / 4 skipped files; 4,712 passed / 759 skipped tests.

The browser test project was not run locally because Playwright Chromium is not installed in this checkout.

Contribution

  • I have followed the contributing guide.

This change and PR description were prepared with OpenAI Codex, then self-reviewed and verified locally. No independent human review has occurred yet.

@code-infra-dashboard

Copy link
Copy Markdown

Deploy preview

https://deploy-preview-49058--material-ui.netlify.app/
QR code for https://deploy-preview-49058--material-ui.netlify.app/

Bundle size

Bundle Parsed size Gzip size
@mui/material ▼-5B(0.00%) ▼-9B(-0.01%)
@mui/lab 0B(0.00%) 0B(0.00%)
@mui/private-theming 0B(0.00%) 0B(0.00%)
@mui/system 0B(0.00%) 0B(0.00%)
@mui/utils 0B(0.00%) 0B(0.00%)

Details of bundle changes


Check out the code infra dashboard for more information about this PR.

@zannager zannager added the scope: breadcrumbs Changes related to the breadcrumbs. label Aug 31, 2026
@zannager
zannager requested a review from DiegoAndai August 31, 2026 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope: breadcrumbs Changes related to the breadcrumbs.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants